import { size, Size, v2, v3, Vec2, Vec3 } from "cc";
import { GlobalEnum } from "../Config/GlobalEnum";

export class StorageTemp {
    userSetting: UserSetting;
    userAssets: UserAsstes;
    levelAssets: LevelAssets;
    constructor() {
        this.userSetting = new UserSetting();
        this.userAssets = new UserAsstes();
        this.levelAssets = new LevelAssets();
    }
}
/**玩家的设置 */
export class UserSetting {
    // 音频开关
    AudioSwith = true;
    // 震动开关
    ShakeSwith = true;
    //显示隐私政策-一次
    showPrivacy = true;
}

//玩家的关卡数据记录
export class LevelAssets {
    curLv = 1;
    data: LevelDataTmp = new LevelDataTmp();
    //记录随机关卡顺序
    randLvArr: number[] = [];
}

//玩家获取的资源数据
export class UserAsstes {
    //表示金币/钱 等数据
    asset = 0;
    //皮肤数据
    skin = {
        choose: 0,
        unlock: [0]
    };
    //抽免费奖次数
    turntableNum = 1;

    //签到记录
    signData = { lastTime: 0, count: -1 };

    //成长属性
    props = {
        hpLv: 1,
        moveSpdLv: 1,
        numLv: 1
    }
    //
    keyNum = 0;
}

//详细的关卡数据-根据游戏变化
export class LevelDataTmp {

    lv = 1;
    //2d
    player = { p: v3() };
    //障碍物2d
    colliders: { [n: string]: { p: Vec3, s: Vec2, r: Vec3 }[] } = {};
    //敌人2d
    enemys: { [n: string]: { p: Vec3, s: Vec2, r: Vec3, isBoss?: boolean, hp?: number, isStatic?: boolean }[] } = {};
    //道具2d
    props: { [n: string]: { p: Vec3, s: Vec2, r: Vec3 }[] } = {};
    //模型 3d
    models: { [n: string]: { p: Vec3, s: Vec3, r: Vec3 }[] } = {};
    //终点位置2d
    endArea = { p: v3(), s: v2() };
    //宝箱位置
    boxMarks: Vec3[] = [];
    //钥匙位置
    keyMarks: Vec3[] = [];
}
